<form id="id_addPayment_form" name="name_addPayment_form" method="post" action="<?php echo func::makeUrl('payment', 'add'); ?>">
    <div class="div_container">
        <div id="addPayment_customer" class="div_left">Tên khách hàng</div>
        <div class="div_right">
            <select name="customerId" onchange="location.href='index.php?mod=payment&act=add&id='+this.options[this.selectedIndex].value">
                <option value="">--Chọn khách hàng--</option>
                <?php
                    while($aRow = mysql::fetchSql($aResult)){
                ?>
                    <option <?php if($aRow['customerId'] == $iCustomerId) echo 'selected'; ?> value="<?php echo $aRow['customerId']; ?>"><?php echo $aRow['name']; ?></option>
                <?php
                    }
                ?>
            </select>
        </div>
    </div>
    <div class="div_container">
        <div class="div_left">ID đơn hàng</div>
        <div class="div_right">
            <select name="orderId">
                <option value="">--Chọn đơn hàng--</option>
                <?php
                    //order
                    $sSql = 'SELECT orderId FROM tnf.order WHERE customerId ='. $iCustomerId .' ORDER BY date ASC';
                    $aOrder = mysql::querySql($sSql);
                    while($aOrderRow = mysql::fetchSql($aOrder)){
                ?>
                        <option value="<?php echo $aOrderRow['orderId']; ?>"><?php echo $aOrderRow['orderId']; ?></option>
                <?php
                    }
                ?>
            </select>
        </div>
    </div>
    <div class="div_container">
        <div class="div_left">Số tiền</div>
        <div class="div_right"><input type="text" name="amount" size="30" /></div>
    </div>
    <div class="div_container">
        <div class="div_button"><input type="submit" name="addPaymentButton" value="Thêm" /></div>
    </div>
</form>